package com.gz.spring.factory;

import com.gz.spring.bean.Monster;

import java.util.HashMap;
import java.util.Map;

public class MyInstanceFactory {
    private  Map<String, Monster> monster_map;

    {
        monster_map = new HashMap<String, Monster>();
        monster_map.put("monster01",new Monster(100,"牛魔王","芭蕉扇"));
        monster_map.put("monster02",new Monster(200,"狐狸精","美人计"));
    }

    public  Monster getMonster(String key) {
        return monster_map.get(key);
    }

}
